const WebSocket=require("ws")
const wss=new WebSocket.Server({port:8080})
wss.on("connection",function(client){
       console.log(client)
  client.on("message",function(message){
       console.log(message)
  })
  client.on("close",function(){
       console.log("close")
  })
  setInterval(function(){
      client.send("我是服务器端"+Date.now())
  },3000)
})